<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="/template/MemberTemplate.xhtml">

    <ui:define name="contentInsert">
        <h2>Search Values</h2><br/>
                    <h:outputText value="NAME: #{userPerformanceMB.searchEventName}"/> 
                    <br/>
                    <h:outputText value="VENUE: #{userPerformanceMB.searchVenueName}"/> 
                    <br/>
                    <h:outputText value="DATE: #{userPerformanceMB.convertDate()}"/> 
                    <br/>
                    <h:outputText value="GENRE: #{userPerformanceMB.convertGenre()}"/> 
                    <br/>
                    <h:outputText value="TYPE: #{userPerformanceMB.convertType()}"/>
    
 
                <h:form>
                        <h3>Search Event</h3>
                  <hr/>
                        Name: <p:inputText value="#{userPerformanceMB.searchEventName}"/>
                        <br/> <br/>
                        Venue: <h:selectOneMenu value="#{userPerformanceMB.searchVenueName}">
                            <f:selectItem itemLabel="Select One..." itemValue= ""/>
                            <f:selectItems value="#{userPerformanceMB.getAllActiveVenues()}"></f:selectItems>
                        </h:selectOneMenu> <br/><br/>
                        Genre:
                        <h:selectOneMenu value="#{userPerformanceMB.searchType}">
                            <f:selectItem itemLabel="Select One..." itemValue= ""/>
                            <f:selectItem itemLabel="Concert" itemValue="Concert"/>
                            <f:selectItem itemLabel="Dance" itemValue="Dance"/>
                            <f:selectItem itemLabel="Musical" itemValue="Musical"/>
                            <f:selectItem itemLabel="Theatre" itemValue="Theatre"/>
                            <f:selectItem itemLabel="Others" itemValue="Others"/>
                        </h:selectOneMenu> <br/><br/>
                        Type:
                        <h:selectOneMenu value="#{userPerformanceMB.searchGenre}">
                            <f:selectItem itemLabel="Select One..." itemValue= ""/>
                            <f:selectItem itemLabel="Comedy" itemValue="Comedy"/>
                            <f:selectItem itemLabel="Horror" itemValue="Horror"/>
                            <f:selectItem itemLabel="Thriller" itemValue="Thriller"/>
                            <f:selectItem itemLabel="Family" itemValue="Family"/>
                            <f:selectItem itemLabel="Drama" itemValue="Drama"/>
                            <f:selectItem itemLabel="Rock" itemValue="Rock"/>
                            <f:selectItem itemLabel="Pop" itemValue="Pop"/>
                            <f:selectItem itemLabel="Rhythms and Blues" itemValue="Rhythms and Blues"/>
                            <f:selectItem itemLabel="Others" itemValue="Others"/>
                        </h:selectOneMenu> <br/><br/>
                        Date:  
                        <p:calendar value="#{userPerformanceMB.findDate}" mindate="#{userPerformanceMB.findingMinDate()}" maxdate="#{userPerformanceMB.findingMaxDate()}" pattern="dd/MM/yyyy"/>
                        <hr/>
                        <p:commandButton update="display" value="Search" action="searchevents.xhtml?faces-redirect=true" />
  
                </h:form>
            <p:layoutUnit position="center" scrollable="true">
                <h:form>
                    <p:tabView>
                        <p:tab title = "Now Showing" id="nowShowing">
                            <h2>#{userPerformanceMB.searchAvailableShowResults()}</h2>
                            <p:dataGrid var="events" value="#{userPerformanceMB.searchAvailableShows()}" rows="5" paginator="true" columns="1">
                                <h:column>
                                    <p:panel id="currentpnl" header="#{events.eventName}" >        
                                        <h:panelGrid columns="2">
                                            <h:column>
                                                <p:panel>
                                                    <p:graphicImage  value="./../#{events.poster}" width="75" height="100"/>
                                                    <br/>
                                                    <p:commandLink immediate="true" action="selectshow?faces-redirect=true">
                                                        <p:graphicImage value="./../ticketingsymbols/info.gif" width="75" height="20" style="vertical-align: text-top; text-align: left"/>
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoEvent}" value="#{events.eventName}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoPoster}" value="#{events.poster}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoDescription}" value="#{events.description}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoId}" value="#{events.id}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoLanguage}" value="#{events.language}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoStartDate}" value="#{events.startDate}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoEndDate}" value="#{events.endDate}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoDuration}" value="#{events.duration}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoGenre}" value="#{events.genre}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoType}" value="#{events.type}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoRating}" value="#{events.rating}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoStakeholder}" value="#{userPerformanceMB.findStakeholder(userPerformanceMB.infoId)}" />
                                                    </p:commandLink>
                                                    <br/>
                                                    <h:outputText style="font-size: 12px; vertical-align: text-top; text-align: left" value="#{events.description}"/>
                                                </p:panel>
                                            </h:column>
                                        </h:panelGrid>
                                    </p:panel>
                                </h:column>
                            </p:dataGrid>
                        </p:tab>
                        <p:tab title = "Coming Soon" id="comingSoon">
                            <h2>#{userPerformanceMB.searchComingSoonResults()}</h2>
                            <p:dataGrid var="events" value="#{userPerformanceMB.searchComingSoon()}" rows="5" paginator="true" columns="1">
                                <h:column>
                                    <p:panel id="comingpnl" header="#{events.eventName}">
                                        <h:panelGrid columns="2">
                                            <h:column>
                                                <p:panel>
                                                    <p:graphicImage  value="./../#{events.poster}" width="75" height="100"/>
                                                    <br/>
                                                    <p:commandLink immediate="true" action="selectshow?faces-redirect=true">
                                                        <p:graphicImage value="./../ticketingsymbols/info.gif" width="75" height="20" style="vertical-align: text-top; text-align: left"/>
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoEvent}" value="#{events.eventName}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoPoster}" value="#{events.poster}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoDescription}" value="#{events.description}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoId}" value="#{events.id}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoLanguage}" value="#{events.language}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoStartDate}" value="#{events.startDate}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoEndDate}" value="#{events.endDate}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoDuration}" value="#{events.duration}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoGenre}" value="#{events.genre}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoType}" value="#{events.type}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoRating}" value="#{events.rating}" />
                                                        <f:setPropertyActionListener target="#{userPerformanceMB.infoStakeholder}" value="#{userPerformanceMB.findStakeholder(userPerformanceMB.infoId)}" />
                                                    </p:commandLink>
                                                    <br/>
                                                    <h:outputText style="font-size: 12px; vertical-align: text-top; text-align: left" value="#{events.description}"/>
                                                </p:panel>
                                            </h:column>
                                        </h:panelGrid>
                                    </p:panel>
                                </h:column>
                            </p:dataGrid>
                        </p:tab>
                    </p:tabView>
                </h:form>
            </p:layoutUnit>
        </ui:define>
</ui:composition>
